(function () {
  'use strict';

  angular.module('BlurAdmin.theme')
      .directive('ngFileSelect', ngFileSelect);

  /** @ngInject */
  function ngFileSelect($parse, $timeout) {
      return {
          link: function ($scope, el, attr) {
              var fn = $parse(attr['ngFileSelect']);
              el.bind('change', function (e) {
                  $scope.file = (e.srcElement || e.target).files[0];
                  $scope.getFile();
            })
          }
    }
  }

})();